home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1997 February: Technology Seed / Mac Tech Seed Feb '97.toast / ODF Release 3 / ODFDev / Draw / Sources / RRectShp.h < prev    next >
Encoding:
Text File  |  1996-12-16  |  2.0 KB  |  83 lines  |  [TEXT/MPS ]

  1. //========================================================================================
  2. //
  3. //    File:                RRectShp.h
  4. //    Release Version:    $ ODF 3 $
  5. //
  6. //    Author:                Henri Lamiraux
  7. //
  8. //    Copyright:            (c) 1993 - 1996 by Apple Computer, Inc., all rights reserved.
  9. //
  10. //========================================================================================
  11.  
  12. #ifndef RRECTSHP_H
  13. #define RRECTSHP_H
  14.  
  15. #ifndef CONSTANT_H
  16. #include "Constant.h"
  17. #endif
  18.  
  19. #ifndef BASESHP_H
  20. #include "BaseShp.h"
  21. #endif
  22.  
  23. #ifndef BOUNDSHP_H
  24. #include "BoundShp.h"
  25. #endif
  26.  
  27. // ----- OS Layer -----
  28.  
  29. #ifndef FWPOINT_H
  30. #include "FWPoint.h"
  31. #endif
  32.  
  33. // ----- Foundation Layer -----
  34.  
  35. #ifndef FWRUNTYP_H
  36. #include "FWRunTyp.h"
  37. #endif
  38.  
  39.  
  40. //========================================================================================
  41. // class CRoundRectShape
  42. //========================================================================================
  43.  
  44. class CRoundRectShape : public CBoundedShape
  45. {
  46. public:
  47.     FW_DECLARE_CLASS
  48.     FW_DECLARE_AUTO(CRoundRectShape)
  49.  
  50. public:
  51.     CRoundRectShape(CDrawPart* drawPart, FW_Fixed radius, FW_Boolean roundEnds);
  52.     CRoundRectShape(CDrawPart* drawPart, FW_CReadableStream& archive);
  53.     
  54. public:
  55.     virtual ~CRoundRectShape();
  56.         
  57. public:
  58.     // ----- Shape -----
  59.     virtual ODShape*    CalcClipShape(Environment* ev);
  60.     virtual ODShape*    CreateShapeOutline(Environment *ev);
  61.  
  62.     virtual FW_Boolean    HitTest(Environment *ev, FW_CGraphicContext& gc, const FW_CMouseEvent& theMouseEvent) const;
  63.     virtual void        RenderShape(Environment* ev, ODFacet* facet, FW_CGraphicContext& gc);
  64.  
  65.     // ----- Archiving -----
  66.     static void*         Read(FW_CReadableStream& stream, FW_ClassTypeConstant type);
  67.     virtual void        Flatten(FW_CWritableStream& archive);
  68.     
  69.     // ----- Scripting -----
  70.     virtual ODDescType    GetObjectClass() const;
  71.  
  72. private:
  73.     virtual void        OutlineShape(FW_CGraphicContext& gc, const FW_CInk& ink, const FW_CStyle& style, const FW_CRect& rect);
  74.  
  75.     FW_CPoint            GetOvalSize(const FW_CRect& bounds) const;
  76.  
  77. private:
  78.     FW_Fixed            fRadius;
  79.     FW_Boolean            fRoundEnds;
  80. };
  81.  
  82. #endif
  83.